package com.yeyks;

import com.yeyks.common.utils.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.TimeZone;

/**
 * cnBooking服务入口
 *
 * @author shuai
 */
@SpringBootApplication
@EnableScheduling
public class YyksOpenCnbookingApplication {
    private static Logger LOGGER = LoggerFactory.getLogger(YyksOpenCnbookingApplication.class);

    public static void main(String[] args) {
        //时区设置，避免服务以后放到docker容器中有时差问题
        TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
        LOGGER.info("system time:[{}]", new Date().toString());
        LOGGER.info("timezone:[{}]", System.getProperty("user.timezone"));
        SpringApplication.run(YyksOpenCnbookingApplication.class, args);
        LOGGER.info(DateUtils.formatYMDHMSStr(LocalDateTime.now()) + ", 夜鱼快宿cnBooking运行成功");
    }
}
